export const formatDate = (time) => {
	time = parseInt(time)
	time = time ? new Date(time) : new Date()
	const year = time.getFullYear()
	const mm = (time.getMonth() + 1) < 10 ? ('0' + (time.getMonth() + 1)) : (time.getMonth() + 1)
	const dd = time.getDate() < 10 ? ('0' + time.getDate()) : time.getDate()
	return `${year}-${mm}-${dd}`
}